[#include "../include/html_header.html"/]
    <link href="${root}/css/global.css" type="text/css" rel="stylesheet"/>
    <link href="${root}/css/layout.css" type="text/css" rel="stylesheet"/>
    <script src="${root}/js/jquery.js" type="text/javascript"></script>
    <script language="JavaScript" type="text/JavaScript">
        function addToCoupon(id) {
            $.post('getcoupon.htm', {
                'id': id
            }, function (data) {
                if (data.status == 1) {
                    alert('领取成功!');
                } else if (data.status == 2) {
                    alert(data.error);
                } else {
                    location.href = '${loginUrl}';
                }
            }, 'json');
        }

    </script>
</head>
<body>
<div class="mainContainer sixteen container">
    <!--Header Block-->
    <div class="header-wrapper">
        [#include "../include/html_header_top.html"/]
    </div>
</div>
<div class="searchwrap w980">


    <div class="center">

        <div>
            [@shop_coupon_page count="20"]
            <ul class="coupon_list">
                [#list tag_list as coupon]
                <li>
                    <div class="coupon_img">
                        <img src="${coupon.couponPicture!}" width="148" height="150"/>
                    </div>
                    <div class="coupon_info">
                        <p>优惠劵名称：${coupon.couponName!}</p>

                        <p>剩余数量：${coupon.couponCount!}</p>

                        <p>
                            有效期：${coupon.couponTime?string('yyyy-MM-dd HH:mm:ss')}——${coupon.couponEndTime?string('yyyy-MM-dd HH:mm:ss')}</p>
                    </div>
                    <div class="coupon_exchange">
                        <p>${coupon.couponPrice!}元</p>
                        <a href="javascript:void(0);" class="book"
                           onclick="javascript:addToCoupon(${coupon.id!});">立即领取</a>
                    </div>
                </li>
                [/#list]
            </ul>
            <div class="clear"></div>
            <div align="center"> [@pagination_style sysPage='1'/]</div>
            [/@shop_coupon_page]
        </div>
    </div>
</div>
[#include "../include/footer.html"/]
</body>
</html>